//用户信息单选
var SYS_USER_CONFIG_SINGLE={
    searchKey:"propKey",
    searchPlaceholder:"用户名或手机号码",
    checkedKey:'id',
    checkedName:'userName',
    table: {
        url: common.util.createUrl('/sys/user/list'),
        cols: [[
            { type: 'radio' }
            , {type: 'numbers', title: '编号'}
            , {field: 'id',  hide:true}
            , {field: 'userName', title: '用户名称', minwidth: 250}
            , {field: 'userEmail', title: '邮箱', minwidth: 150}
            , {field: 'userMobile', title: '手机', minwidth: 150}
        ]]
    },
    windows:{
        title:'用户选择'
    },
    done:$.noop
}
//订量单位
var BASE_UOM_CONFIG_SINGLE={
    searchKey:"name",
    searchPlaceholder:"请输入",
    checkedKey:'id',
    checkedName:'uomName',
    table: {
        where:{isLeaf:1},
        url: common.util.createUrl('/base/uom/list'),
        cols: [[
            { type: 'radio' }
            , {type: 'numbers', title: '编号'}
            , {field: 'id',  hide:true}
            , {field: 'uomName', title: '计量位单',  minwidth: 80}
            , {field: 'uomName', title: '计量位单',  width: 80}
            , {field: 'uomName', title: '计量位单',  width: 80}
        ]]
    },
    windows:{
        title:'计量单位选择'
    },
    done:$.noop
}

//商品信息单选
var BASE_GOODS_CONFIG_SINGLE={
    searchKey:"propKey",
    searchPlaceholder:"商品编码或名称",
    checkedKey:'id',
    checkedName:'goodsName',
    table: {
        url: common.util.createUrl('/base/goods/list'),
        cols: [[
            { type: 'radio' }
            , {type: 'numbers', title: '编号'}
            , {field: 'id',  hide:true}
            , {field: 'goodsCode', title: '商品编码',  minwidth: 80}
            , {field: 'goodsName', title: '商品名称',  width: 80}
            , {field: 'goodsModel', title: '商品型号',  width: 80}
            , {field: 'goodsSpace', title: '商品规则',  width: 80}
        ]]
    },
    windows:{
        title:'商品选择'
    },
    done:$.noop
}

//商品信息多选
var BASE_GOODS_CONFIG_MULTIPLE={
    searchKey:"propKey",
    searchPlaceholder:"商品编码或名称",
    checkedKey:'id',
    checkedName:'goodsName',
    table: {
        url: common.util.createUrl('/base/goods/list'),
        cols: [[
            { type: 'checkbox' }
            , {type: 'numbers', title: '编号'}
            , {field: 'id',  hide:true}
            ,{ title: '基本单位', field: 'baseUomId',  hide: true}
            ,{ title: '辅助单位', field: 'auxUomId',  hide: true}
            ,{ title: '库存单位', field: 'qtyUomId',  hide: true}
            , {field: 'goodsCode', title: '商品编码', width: 80, minwidth: 50}
            , {field: 'goodsName', title: '商品名称',  width: 150}
            , {field: 'goodsModel', title: '商品型号',  width: 80}
            , {field: 'goodsSpec', title: '商品规格',  width: 80}
            , {field: 'listPrice', title: '商品挂牌价',  hide: true}
            ,{ title: '基本单位', field: 'baseUomName' }
            ,{ title: '库存单位', field: 'qtyUomName' }
            ,{ title: '辅助单位', field: 'auxUomName' }
            ,{ title: '件换算', field: 'converUnit1' }
            ,{ title: '片换算', field: 'converUnit2' }
        ]]
    },
    windows:{
        title:'商品选择',
        area: ['900px', ($(window).height() *0.85)+'px'] //自定义文本域宽高
    },
    tree:{
        url:'/base/class/tree',
        key:'classId'
    },
    done:$.noop
}


//门店信息单选
var BASE_STORE_CONFIG_SINGLE={
    searchKey:"keys",
    searchPlaceholder:"门店编码或名称",
    checkedKey:'id',
    checkedName:'storeName',
    table: {
        url: common.util.createUrl('/base/store/list')
        , cols: [[
            { type: 'radio' }
            , {type: 'numbers', title: '编号'}
            , {title: '组织id', field: 'entId', hide: true}
            , {field: 'id', hide: true}
            , {title: '门店编码', field: 'storeCode'}
            , {title: '门店名称', field: 'storeName'}
            , {title: '门店联系人', field: 'storeContactName'}
        ]]
    },
    windows:{
        title:'门店选择'
    },
    done:$.noop
}


//门店信息多选
var BASE_STORE_CONFIG_MULTIPLE={
    searchKey:"keys",
    searchPlaceholder:"门店编码或名称",
    checkedKey:'id',
    checkedName:'storeName',
    table: {
       url: common.util.createUrl('/base/store/list')
        , cols: [[
              { type: 'checkbox' }
            , {type: 'numbers', title: '编号'}
            , {title: '组织id', field: 'entId', hide: true}
            , {field: 'id', hide: true}
            , {title: '门店编码', field: 'storeCode'}
            , {title: '门店名称', field: 'storeName'}
            , {title: '门店联系人', field: 'storeContactName'}
         ]]
    },
    windows:{
        title:'门店选择'
    },
    done:$.noop
}



//客户信息单选
var BASE_CUSTOMER_CONFIG_SINGLE={
    searchKey:"keys",
    searchPlaceholder:"客户编码或名称",
    checkedKey:'id',
    checkedName:'customerName',
    table: {
        url: common.util.createUrl('/base/customer/list')
        ,cols: [[
            { type: 'radio' }
            ,{type: 'numbers', title: '编号' }
            ,{ title: '组织id', field: 'entId',  hide: true}
            ,{ field: 'id',  hide: true }
            ,{ title: '客户编码', field: 'customerCode'}
            ,{ title: '客户名称', field: 'customerName'}
            ,{ title: '客户联系人', field: 'customerContactName'}
        ]]
    },
    windows:{
        title:'客户选择'
    },
    done:$.noop
}

//客户信息多选
var BASE_CUSTOMER_CONFIG_MULTIPLE={
    searchKey:"keys",
    searchPlaceholder:"客户编码或名称",
    checkedKey:'id',
    checkedName:'customerName',
    table: {
          url: common.util.createUrl('/base/customer/list')
         ,cols: [[
             {type:'checkbox'}
            ,{type: 'numbers', title: '编号' }
            ,{ title: '组织id', field: 'entId',  hide: true}
            ,{ field: 'id',  hide: true }
            ,{ title: '客户编码', field: 'customerCode'}
            ,{ title: '客户名称', field: 'customerName'}
            ,{ title: '客户联系人', field: 'customerContactName'}
        ]]
    },
    windows:{
        title:'客户选择'
    },
    done:$.noop
}

//商品信息单选
var BASE_WAREHOUSE_CONFIG_SINGLE={
    searchKey:"propKey",
    searchPlaceholder:"仓库编码或名称",
    checkedKey:'id',
    checkedName:'warehouseName',
    table: {
        url: common.util.createUrl('/base/warehouse/list'),
        cols: [[
            { type: 'radio' }
            , {type: 'numbers', title: '编号'}
            , {field: 'id',  hide:true}
            ,{ title: '仓库编码', field: 'warehouseCode'}
            ,{ title: '仓库名称', field: 'warehouseName'}
        ]]
    },
    windows:{
        title:'仓库选择'
    },
    done:$.noop
}



//预订单单选
var SALE_PROB_HEAD_CONFIG_SINGLE={
    searchKey:"propKey",
    searchPlaceholder:"预订单编码",
    checkedKey:'id',
    checkedName:'probNo',
    table: {
        url: common.util.createUrl('/sale/probHead/list'),
        cols: [[
            { type: 'radio' }
            , {type: 'numbers', title: '编号'}
            , {field: 'id',  hide:true}
            ,{ title: '预订单编码', field: 'probNo' ,width:180}
            ,{ title: '订单日期', field: 'probDate',width:100 }
            ,{ title: '门店id', field: 'storeId',  hide: true}
            ,{ title: '门店名称', field: 'storeName' ,width:150}
            ,{ title: '客户ID', field: 'customerId',  hide: true}
            ,{ title: '客户编码', field: 'customerCode' }
            ,{ title: '客户名称', field: 'customerName',width:100 }
            ,{ title: '客户电话', field: 'customerContactTel' ,width:120}
            ,{ title: '导购员名称', field: 'guideName',width:100 }
            ,{ title: '订单状态', field: 'orderState' ,templet: function (row) { return common.dist.getValue("sale.ProbHead_OrderStateEnum",row.orderState);}}
            ,{ title: '审核人ID', field: 'checkUserId',  hide: true}
            ,{ title: '审核人', field: 'checkUserName',  hide: true}
            ,{ title: '审核时间', field: 'checkDate',width:150 }
        ]]
    },
    windows:{
        title:'预订单选择'
    },
    done:$.noop
}



//销售订单单选
var SALE_ORDER_HEAD_CONFIG_SINGLE={
    searchKey:"propKey",
    searchPlaceholder:"订单编码",
    checkedKey:'id',
    checkedName:'orderNo',
    table: {
        url: common.util.createUrl('/sale/orderHead/list'),
        cols: [[
            { type: 'radio' }
            , {type: 'numbers', title: '编号'}
            , {field: 'id',  hide:true}
            ,{ title: '预订单编码', field: 'orderNo' ,width:180}
            ,{ title: '订单日期', field: 'orderDate',width:100 }
            ,{ title: '门店id', field: 'storeId',  hide: true}
            ,{ title: '门店名称', field: 'storeName' ,width:150}
            ,{ title: '客户ID', field: 'customerId',  hide: true}
            ,{ title: '客户编码', field: 'customerCode' }
            ,{ title: '客户名称', field: 'customerName',width:100 }
            ,{ title: '客户电话', field: 'customerContactTel' ,width:120}
            ,{ title: '导购员名称', field: 'guideName',width:100 }
            ,{ title: '订单状态', field: 'orderState' ,templet: function (row) { return common.dist.getValue("sale.OrderHead_OrderStateEnum",row.orderState);}}
            ,{ title: '审核人ID', field: 'checkUserId',  hide: true}
            ,{ title: '审核人', field: 'checkUserName',  hide: true}
            ,{ title: '审核时间', field: 'checkDate',width:150 }
        ]]
    },
    windows:{
        title:'销售订单选择'
    },
    done:$.noop
}


var BASE_SUPPLIER_CONFIG_SINGLE={

    searchKey:"propKey",
    searchPlaceholder:"订单编码",
    checkedKey:'id',
    checkedName:'orderNo',
    table: {
        url: common.util.createUrl('/base/supplier/list'),
        cols: [[
            { type: 'radio' }
            , {type: 'numbers', title: '编号'}
            , {field: 'id',  hide:true}
            ,{ title: '供应商id', field: 'id',  hide: true}
            ,{ title: '供应商编码', field: 'supplierCode' }
            ,{ title: '供应商名称', field: 'supplierName' }
        ]]
    },
    windows:{
        title:'供应商选择'
    },
    done:$.noop
}




//采购订单单选
var POS_PURCBASE_CONFIG_SINGLE={
    searchKey:"propKey",
    searchPlaceholder:"采购订单编码",
    checkedKey:'id',
    checkedName:'probNo',
    table: {
        url: common.util.createUrl('/pos/purchaseHead/list'),
        where:{purchaseState:2},
        cols: [[
            { type: 'radio' }
            ,{type: 'numbers', title: '编号' }
            ,{ field: 'id',  hide: true }
            ,{ title: '组织ID', field: 'entId',  hide: true}
            ,{ title: '主键ID', field: 'id',  hide: true}
            ,{ title: '单据编码', field: 'purchaseNo' ,width:150}
            ,{ title: '单据日期', field: 'purchaseDate' ,width:100}
            ,{ title: '供应商名称', field: 'supplierName' ,width:150}
            ,{ title: '总采购量', field: 'sumNum' ,width:90}
            ,{ title: '总入库量', field: 'inSumNum' ,width:90}
            ,{ title: '未入库量', field: 'inSumNum' ,width:90,templet:function (row) {
                    return common.util.toFixed(row.sumNum-row.inSumNum);
             }}
            //,{ title: '采购员名称', field: 'guideName',width:150 }
            //,{ title: '订单类型', field: 'purchaseType' ,templet: function (row) { return common.dist.getValue("pos.PurchaseHead_PurchaseTypeEnum",row.purchaseType);}}
            //,{ title: '订单状态', field: 'purchaseState' ,templet: function (row) { return common.dist.getValue("pos.PurchaseHead_PurchaseStateEnum",row.purchaseState);}}
            ,{ title: '备注', field: 'remark'}
            ,{ title: '供应商id', field: 'supplierId',  hide: true}
            ,{ title: '采购员Id', field: 'guideId',  hide: true}

        ]]
    },
    windows:{
        title:'采购订单选择',
        area: ['900px', ($(window).height() *0.85)+'px'] //自定义文本域宽高
    },
    done:$.noop
}
